Part Number Hot Search : 
25D121K SS1P4L HT45F23A 25LC64 BC859 SPP46N03 L5235 HWS2702
Product Description
Full Text Search
 

To Download TOOLS-MISC Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  a aa a engineer to engineer note ee-159 technical notes on using analog devices? dsp components and development tools phone: (800) analog-d, fax: (781) 461-3010, email: dsp.support@analog.com, ftp: ftp.analog.com, web: www.analog.com/dsp copyright 2002, analog devices, inc. all rights reserved. analog devices assumes no responsib ility for customer product design or the use or application of customers? products or for any infringements of patents or rights of others which may result from analog devices assistance. all trademarks and logos are property of their respective holders. information furnished by analog devices applications and development tools engineers is believed to be accurate and reliable, however no re sponsibility is assumed by analog devices regarding the technical accuracy of the content provided in all analog devices? engineer-to-engineer notes. initializing dsp system & control registers from c and c++ by dan ledger submitted 11/6/01 this application note will present techniques for setting up memory-mapped and non memory-mapped control and system registers on adi dsps from c or c++. memory mapped control registers the memory mapped control registers can be written and read by simply de-referencing a c pointer. de- referencing a c pointer simply means accessing the memory which the pointer is currently pointing to. for example, to place a value of 0xffff at address 0x10, the following notation is used: * (int *) 0x10 = 0xffff; the first ?*? is the de-reference syntax. this is followed by, ?(int *)?, which is called a cast and tells the compiler how to handle the data following it. the * (int *) notation is the key to reading and writing explicit addresses in memory. visualdsp provides an include file for each processor which holds memory-mapped control register addresses and bit fields. by including this file in a .c file, you can take advantage of all of these preprocessor variables when setting up control registers. these files are typically named defxxxx.h where xxxx is the processor type and can be found in the include directory. #include copy a value of 0x10 into address 0x0: * (int *) 0x0 = 0x10 ; copy a value of 0x10 into the ioctl register: * (int *) ioctl = 0x10 ; set the sdpss bit in the ioctl register: * (int *) ioctl |= sdpss; set multiple bits in the ioctl register: * (int *) ioctl |= sdpss|sdbn2|sdbs0; clear the sdpss bit in the ioctl register: * (int *) ioctl &= ~sdpss;
ee-159 page 2 technical notes on using analog devices? dsp components and development tools phone: (800) analog-d, fax: (781)461-3010, email: dsp.support@analog.com, ftp: ftp.analog.com, web: www.analog.com/dsp clear multiple bits in the ioctl register: * (int *) ioctl &= (~sdpss) & (~sdbn2) & (~sdbs0); because the logical operations are all happening in the preprocessor (i.e. at compile time), the code generated by the compiler to initialize memory-mapped registers is just as efficient as implementing it in straight assembly language! non-memory mapped control registers control and system registers which are not memory-mapped, like the mode2 register on the sharc? or the imask register on a 218x part, require the assistance of in-lined assembly when working in c. fortunately, there are some nice macros provided in the include files provided with visualdsp? which can help out. these functions can be found in the sysreg.h file located in the include directory and contain the following c prototypes : sysreg_read(r) sysreg_write(r, val) sysreg_bit_clr(r, bits) sysreg_bit_set(r, bits) sysreg_bit_tgl(r, bits) sysreg_bit_tst(r, bits) sysreg_tst(r, bits) in these functions, ?r? is the enumerated register name and ?val? & ?bits? are either the direct value or the bit-fields to be set, cleared, etc. for example, to setup the mode2 register on the sharc, in-lined assembly can be used like so: asm("bit clr mode2 flg2o | flg1o | flg0o; "); or, a sysreg function can be used: sysreg_bit_clr(sysreg_mode2, flg2o | flg1o | flg0o); the enumerations for the control registers are specified at the bottom of sysreg.h located in the include directory. when using inline-assembly to setup registers, it is important to include the appropriate .h file for the assembly pre-processor as the c file and the in-lined assembly are preprocessed separately. by performing this declaration at the top of a c file, you are guaranteed that both your c and assembly preprocessor variable references will be resolved. #include asm (?#include ?);


▲Up To Search▲   

 
Price & Availability of TOOLS-MISC

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X